package com.polymorphic.polyarry;

/**
 * @Author 小闽
 * @Date 2024/8/13 9:43
 * @PackageName: com.polymorphic.polyarry
 * @ClassName: Teacher
 * @Description: 老师类
 * @Version 1.0
 */
public class Teacher extends Person{
    private double salary;

    public Teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String say() {
        return super.say() + "salary" + salary;
    }

    // 特有方法
    public void teach(){
        System.out.println("老师" + getName() + "正在授课");
    }
}
